package svc

import (
	"Junior_two/subject/cart/cartapi/internal/config"
	"Junior_two/subject/cart/cartrpc/cartrpcclient"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config     config.Config
	CartServer cartrpcclient.CartRpc
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:     c,
		CartServer: cartrpcclient.NewCartRpc(zrpc.MustNewClient(c.CartServer)),
	}
}
